home *** CD-ROM | disk | FTP | other *** search
- /* atari specific stuff */
-
- #include <stdio.h>
-
- char * def_skel_file()
- {
- char * foo = getenv("FLEX_DEF");
-
- if (foo)
- return(foo);
- else
- return("flexdef.skl");
- }
-
-
- char * fast_skel_file()
- {
- char * foo = getenv("FLEX_FAST");
-
- if (foo)
- return(foo);
- else
- return("flexfast.skl");
- }
-
- int abs(a)
- int a;
- {
- if (a >= 0)
- return(a);
- else
- return(-a);
- }
-
- int cr_filtering_read(f, buf, nbytes)
- FILE * f;
- char * buf;
- int nbytes;
- {
- char * b = buf;
- int nbytes_read = 0;
- int c;
-
- for ( ; nbytes > 0 ; nbytes--)
- {
- c = fgetc(f);
- if (c == EOF) break;
- if (c != '\r')
- {
- *b++ = c;
- nbytes_read++;
- }
- }
- return (nbytes_read);
- }
-
- /* should migrate this into lib */
- puts(str)
- char * str;
- {
- char c;
- int eol_flag = 0;
-
- while (c = *str++)
- {
- eol_flag = (c == '\r');
- fputc(c, stdout);
- }
- if (!eol_flag)
- fputc('\n', stdout);
- }